package com.edu.imau.IC_CARD;

import com.edu.imau.ManagerRoleInformation.Manager;
import com.edu.imau.ParkingDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ljx
 * @date 2022/12/29 12:41
 */
@WebServlet("/ICupdate")
public class ICUpdateServlet extends HttpServlet {
    private ParkingDao dao = new ParkingDao();

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1：接收请求 处理参数
        String id_str = request.getParameter("card_id");
        //2:调用model
        if (id_str != null) {
            IC ic = dao.getICById(Integer.parseInt(id_str));
            //3:展示view
            request.setAttribute("ic", ic);
            request.getRequestDispatcher("icmanager.jsp").forward(request, response);
        }

    }
}
